<%@page import="java.util.Locale"%>
<%@page import="java.util.ResourceBundle"%>
<%@page import="java.util.List"%>
<%@page import="entity.Tag"%>
<% 
	request.setCharacterEncoding("utf-8");
	response.setHeader("Content-Type","text/html; charset=utf-8");
	response.setHeader("Vary","Accept-Encoding");
	response.setCharacterEncoding("utf-8");
%>
<%
	HttpSession ss = request.getSession(true);
	ResourceBundle resource = (ResourceBundle) ss.getAttribute("language");
	int currentPage = Integer.valueOf(request.getAttribute("currentPage").toString());
	String language = resource.getString("code");
%>
<%
	List<Tag> list = (List<Tag>) request.getAttribute("listTag");
	String title = resource.getString("page")+" "+(currentPage+1)+" - "+resource.getString("list_tag");
	String description = title+resource.getString("description");
	String keywords = resource.getString("keyword");
	String tag = "tag";
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
	<jsp:param name="language" value="<%=language %>"/>
	<jsp:param name="tag" value="<%=tag %>"/>
</jsp:include>

<div class="bd">
	<h2 class="tt"><%=resource.getString("list_tag")%></h2>
	<p><%=resource.getString("text_tag") %></p>
	<ul class="lt">
		<%
			for (Tag item : list) {
		%>
		<li><a href="<%=request.getContextPath()%>/<%=resource.getString("code")%>/tag/<%=item.getAlias()%>"><%=item.getName()%></a><span
			class="it"> x <%=item.getCount()%></span></li>
		<%
			}
		%>
		<li class="paginate">
			<%
				if(currentPage>0){
				%>							
					<a href="<%=request.getContextPath()%>/<%=resource.getString("code")%>/list-tags/<%=currentPage-1%>">Previous</a>
				<%							
				}
			%>					
			<a href="<%=request.getContextPath()%>/<%=resource.getString("code")%>/list-tags/<%=currentPage+1%>">Next</a>
		</li>
	</ul>
	<div class="clear"></div>
</div>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="<%=language %>" />
</jsp:include>
